package com.lry.selector;

import com.lry.message.Message;
import com.lry.message.MessageQueue;

import java.util.List;
import java.util.Random;

public class RandomMessageSelector implements MessageSelector{

    @Override
    public MessageQueue select(List<MessageQueue> messageQueueList, Message message, Object arg) {
        Random random = new Random();
        int index = random.nextInt(messageQueueList.size());
        return messageQueueList.get(index);
    }

}
